# 将文件拷贝到指定目录
# 并刷新 tex 数据库
# 由于 ElegantNote 已经自带了, 因此不能重名

OBJS = $(wildcard *.cls)
lsr_dir = /usr/local/share/texmf
target_dir = /usr/local/share/texmf/tex/local

all: $(OBJS)
	for file in $(OBJS); do \
	  echo $$file; \
	  cp -f ./$$file $(target_dir)/$$file; \
	done
	texhash

init:
	mkdir -p $(target_dir)
	mkdir -p $(lsr_dir)
	cp -f ./ls-R $(lsr_dir)/ls-R
	chmod 664 $(lsr_dir)/ls-R

install: all

fedora:
	mkdir -p /usr/share/texlive/texmf-dist/tex/custom
	for file in $(OBJS); do \
		echo $$file; \
		cp -f ./$$file /usr/share/texlive/texmf-dist/tex/custom/$$file; \
	done
	texhash

uninstall:
	for file in $(OBJS); do \
		$(RM) $(target_dir)/$$file ; \
	done

	texhash
